package com.szmmsoft.mp.common.exception;

import lombok.Data;

/**
 * Description of the class.
 *
 * @author ethan
 * @version 1.0.0
 * @since 2024-10-21
 */
@Data
public class ValidatorException extends RuntimeException {
    private Integer code;
    private String msg;

    public ValidatorException(String msg) {
        super(msg);
        this.code = BusinessCode.INTERNAL_SERVER_ERROR.getCode();
        this.msg = msg;
    }
    public ValidatorException(BusinessCode errorCode) {
        super(errorCode.getMsg());
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
    }
    public ValidatorException(String msg, Throwable e) {
        super(msg, e);
        this.code = BusinessCode.INTERNAL_SERVER_ERROR.getCode();
        this.msg = msg;
    }
}
